CS 184 Projects‎ > ‎

HW6: Ray Tracing Extension

Partner: Thanh Hai Mai
Primitives with HDR mapping and Monte Carlo antialiasing

In this project, we optimized our ray tracer, perfected some previous features and added more features into our project. Because the time is short (we implemented this project in a few days and there is a final week ahead), we could not make fancier global illumination or photon mapping for caustic effect.
Here are new features:
  • Global Illumination: we implemented simple path tracer to trace a number of bouncing rays from diffuse surface. Instead of tracing perfect reflected ray like in the previous project, we perturb the reflected rays (randomly pick rays in the upper hemisphere) and use Monte Carlo to find the color at a particular pixel. The path tracer runs much slower than the ray tracer.
  • Environment Mapping: we added Environment class, ConstantEnvironment class that returns the constant color background and HDREnvironment class that stores the *.pfm environment file. When a ray misses all the objects, it will return the environment color instead of returning black background like the previous project.
  • Motion Blur: we added time variable to each ray so that each ray will trace at different time. For a given interval, we find the (startTime + random * endTime) and set that time into a ray. This will make the moving objects look blur. 
  • New Primitives: We use math methods to find out the intersections of the rays with the primitives (they are not made from triangles so we can save space storage and run faster)
    • Box
    • Cone 
    • Cylinder
We also optimize our Kd tree acceleration. Now a 100,000 triangle Stanford Dragon scene runs in less than 60s and a thousand sphere scene runs in 0.3s!

We fixed our Refraction feature to output more realistic by using Fresnel equation and good approximation which is referenced in the book (Schlick, 1994a) Fundamentals of Computer Graphics 3rd Edition by Peter Shirley and Steve Marschner

Enough said, now here are our results: 
  • Global illumination: notice there is color bleeding from the color wall to the primitives: the left side of the box has red color while the sphere and the cone have both red and green colors on both sides. The white top and bottom floor also have color bleeding from the red and green wall. The box is primitive so that we can save a lot of time in rendering instead of rendering 12 triangles.

100 sample rays/pixel with 50 rays for area light
100 sample rays/pixel with 50 sample rays for area light
500 sample rays/pixel with 50 sample rays for area light
500 sample rays/pixel with 50 sample rays for area light
1000 sample rays/ pixel with 100 sample rays for area light
1000 sample rays/pixel with 100 sample rays for area light
  • Environment Mapping
Environment Mapping
  • Motion Blur: The pink and cyan balls are in motion while the yellow ball is staying still
Motion blur: pink and cyan balls are in motion
  • New Primitives: Cone: see the pictures above
Cylinder
box





Original Text: